home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 August / macformat-027.iso / mac / Shareware City / Developers / Oberon⁄F / Samples / Mod / Ex6 (.txt) < prev    next >
Encoding:
Oberon Document  |  1994-06-07  |  3.2 KB  |  76 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Geneva
  16. Geneva
  17. Geneva
  18. L Frutiger Light
  19. Geneva
  20. MODULE SamplesEx6;
  21.     IMPORT Files, Views, Dialog, TextModels, TextMappers, TextViews;
  22.         adr*: RECORD (Dialog.Interactor)
  23.             name*:    ARRAY 64 OF CHAR;
  24.             street*:    ARRAY 64 OF CHAR;
  25.             city*:    ARRAY 24 OF CHAR;
  26.             state*:    ARRAY 6 OF CHAR;
  27.             ZIP*:    ARRAY 6 OF CHAR;
  28.             country*:    ARRAY 16 OF CHAR;
  29.             customer:    LONGINT;
  30.             update*:    BOOLEAN;
  31.             Text*:    PROCEDURE
  32.         END;
  33.     PROCEDURE Text;
  34.         VAR stationary: BOOLEAN; loc: Files.Locator; name: Files.Name;
  35.             v: Views.View; t: TextModels.Model; f: TextMappers.Formatter;
  36.     BEGIN
  37.         Dialog.GetIntSpec("", stationary, loc, name);
  38.         IF loc # NIL THEN
  39.             v := Views.OldView(loc, name);
  40.             IF v IS TextViews.View THEN
  41.                 t := v(TextViews.View).ThisModel();
  42.                 f.ConnectTo(t);
  43.                 f.SetPos(t.Length());
  44.                 f.WriteString(adr.name); f.WriteTab;
  45.                 f.WriteString(adr.street); f.WriteTab;
  46.                 f.WriteString(adr.city); f.WriteTab;
  47.                 f.WriteString(adr.state); f.WriteTab;
  48.                 f.WriteString(adr.ZIP); f.WriteTab;
  49.                 f.WriteString(adr.country); f.WriteTab;
  50.                 f.WriteInt(adr.customer); f.WriteTab;
  51.                 f.WriteBool(adr.update); f.WriteLn;
  52.                 Views.Open(v, NIL, "");
  53.                 adr.name := ""; adr.street := ""; adr.city := ""; adr.state := "";
  54.                 adr.ZIP := ""; adr.country := ""; adr.customer := 0; adr.update := FALSE;
  55.                 adr.Notify
  56.             END
  57.         END
  58.     END Text;
  59. BEGIN
  60.     adr.Text := Text
  61. END SamplesEx6.
  62. TextControllers.StdCtrlDesc
  63. TextControllers.ControllerDesc
  64. Containers.ControllerDesc
  65. Controllers.ControllerDesc
  66. TextRulers.StdRulerDesc
  67. TextRulers.RulerDesc
  68. TextRulers.StdStyleDesc
  69. TextRulers.StyleDesc
  70. TextRulers.AttributesDesc
  71. Geneva
  72. Example 6
  73. This example combines features of earlier examples: it allows to enter an address via a mask, and a push button causes the entered data to be appended to a text in a file. Afterwards, the entered data is cleared again. In order to be able to notify controls of a change in the displayed data, the interactor must be an extension of a Dialog.Interactor. Such an interactor has a Notify procedure, for exactly this purpose.
  74. Geneva
  75. Documents.ControllerDesc
  76.